/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hello;

import javax.microedition.rms.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.wireless.messaging.*;
import org.netbeans.microedition.lcdui.WaitScreen;
import org.netbeans.microedition.util.SimpleCancellableTask;
/**
 * @author Abhinav
 */
public class ClientApplet extends MIDlet implements CommandListener {
    
    private boolean midletPaused = false;
    private RecordStore rstore;
    //Alert nalert;
    private String messege, s, reply, server = "+918826561956";
    MessageConnection clientConn;
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Command Exit;
    private Command backCommand;
    private Command SignUp;
    private Command ExistingUser;
    private Command NewUser;
    private Command okCommand;
    private Command backCommand1;
    private Command okCommand1;
    private Command backCommand2;
    private Command okCommand3;
    private Command okCommand2;
    private Command screenCommand;
    private Command okCommand5;
    private Command okCommand6;
    private Command okCommand4;
    private Command okCommand8;
    private Command okCommand7;
    private Command okCommand10;
    private Command okCommand9;
    private Command okCommand12;
    private Command okCommand11;
    private Form form;
    private ImageItem imageItem;
    private StringItem stringItem;
    private StringItem stringItem1;
    private Form form1;
    private StringItem stringItem2;
    private TextField textField2;
    private TextField textField;
    private TextField textField6;
    private TextField textField7;
    private Form form2;
    private StringItem stringItem3;
    private TextField textField3;
    private Form form3;
    private TextField textField4;
    private TextField textField5;
    private Alert alert1;
    private Alert alert;
    private Alert alert2;
    private Alert alert4;
    private Alert alert3;
    private Image image1;
    private SimpleCancellableTask task;
//</editor-fold>//GEN-END:|fields|0|
    private Display display;

    /**
     * The HelloMIDlet constructor.
     */
    public ClientApplet() {
    }

//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
//</editor-fold>//GEN-END:|methods|0|
//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initializes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
//</editor-fold>//GEN-END:|0-initialize|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getForm());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
//</editor-fold>//GEN-END:|3-startMIDlet|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
//</editor-fold>//GEN-END:|4-resumeMIDlet|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
//</editor-fold>//GEN-END:|5-switchDisplayable|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == alert) {//GEN-BEGIN:|7-commandAction|1|83-preAction
            if (command == okCommand7) {//GEN-END:|7-commandAction|1|83-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|7-commandAction|2|83-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|106-preAction
        } else if (displayable == alert2) {
            if (command == okCommand9) {//GEN-END:|7-commandAction|3|106-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|7-commandAction|4|106-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|5|119-preAction
        } else if (displayable == alert3) {
            if (command == okCommand12) {//GEN-END:|7-commandAction|5|119-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|7-commandAction|6|119-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|7|114-preAction
        } else if (displayable == alert4) {
            if (command == okCommand11) {//GEN-END:|7-commandAction|7|114-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm3());//GEN-LINE:|7-commandAction|8|114-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|9|35-preAction
        } else if (displayable == form) {
            if (command == ExistingUser) {//GEN-END:|7-commandAction|9|35-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|7-commandAction|10|35-postAction
                // write post-action user code here
            } else if (command == Exit) {//GEN-LINE:|7-commandAction|11|19-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|12|19-postAction
                // write post-action user code here
            } else if (command == NewUser) {//GEN-LINE:|7-commandAction|13|33-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|7-commandAction|14|33-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|15|25-preAction
        } else if (displayable == form1) {
            if (command == backCommand) {//GEN-END:|7-commandAction|15|25-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|16|25-postAction
                // write post-action user code here
            } else if (command == okCommand1) {//GEN-LINE:|7-commandAction|17|45-preAction
                // write pre-action user code here
                switchDisplayable(getAlert(), getForm());//GEN-LINE:|7-commandAction|18|45-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|19|42-preAction
        } else if (displayable == form2) {
            if (command == backCommand1) {//GEN-END:|7-commandAction|19|42-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|20|42-postAction
                // write post-action user code here
            } else if (command == okCommand) {//GEN-LINE:|7-commandAction|21|40-preAction
                // write pre-action user code here
                switchDisplayable(getAlert2(), getForm3());//GEN-LINE:|7-commandAction|22|40-postAction
                // write post-action user code here
            } else if (command == okCommand4) {//GEN-LINE:|7-commandAction|23|116-preAction
                // write pre-action user code here
                switchDisplayable(getAlert3(), getForm2());//GEN-LINE:|7-commandAction|24|116-postAction
                // write post-action user code here
            } else if (command == okCommand8) {//GEN-LINE:|7-commandAction|25|86-preAction
                // write pre-action user code here
                switchDisplayable(getAlert1(), getForm());//GEN-LINE:|7-commandAction|26|86-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|27|56-preAction
        } else if (displayable == form3) {
            if (command == backCommand2) {//GEN-END:|7-commandAction|27|56-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|7-commandAction|28|56-postAction
                // write post-action user code here
            } else if (command == okCommand2) {//GEN-LINE:|7-commandAction|29|58-preAction
                // write pre-action user code here
                switchDisplayable(getAlert4(), getForm2());//GEN-LINE:|7-commandAction|30|58-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|31|7-postCommandAction
        }//GEN-END:|7-commandAction|31|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|32|
//</editor-fold>//GEN-END:|7-commandAction|32|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Exit ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of Exit component.
     * @return the initialized component instance
     */
    public Command getExit() {
        if (Exit == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            Exit = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit
            // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return Exit;
    }
//</editor-fold>//GEN-END:|18-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initiliazed instance of form component.
     * @return the initialized component instance
     */
    public Form getForm() {
        if (form == null) {//GEN-END:|14-getter|0|14-preInit
            // write pre-init user code here
            form = new Form("My Bil Buddy", new Item[]{getStringItem(), getImageItem(), getStringItem1()});//GEN-BEGIN:|14-getter|1|14-postInit
            form.addCommand(getExit());
            form.addCommand(getNewUser());
            form.addCommand(getExistingUser());
            form.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return form;
    }
//</editor-fold>//GEN-END:|14-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|24-getter|0|24-preInit
    /**
     * Returns an initiliazed instance of backCommand component.
     * @return the initialized component instance
     */
    public Command getBackCommand() {
        if (backCommand == null) {//GEN-END:|24-getter|0|24-preInit
            // write pre-init user code here
            backCommand = new Command("Back", Command.BACK, 0);//GEN-LINE:|24-getter|1|24-postInit
            // write post-init user code here
        }//GEN-BEGIN:|24-getter|2|
        return backCommand;
    }
//</editor-fold>//GEN-END:|24-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: SignUp ">//GEN-BEGIN:|27-getter|0|27-preInit
    /**
     * Returns an initiliazed instance of SignUp component.
     * @return the initialized component instance
     */
    public Command getSignUp() {
        if (SignUp == null) {//GEN-END:|27-getter|0|27-preInit
            // write pre-init user code here
            SignUp = new Command("Ok", Command.OK, 0);//GEN-LINE:|27-getter|1|27-postInit
            // write post-init user code here
        }//GEN-BEGIN:|27-getter|2|
        return SignUp;
    }
//</editor-fold>//GEN-END:|27-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: NewUser ">//GEN-BEGIN:|32-getter|0|32-preInit
    /**
     * Returns an initiliazed instance of NewUser component.
     * @return the initialized component instance
     */
    public Command getNewUser() {
        if (NewUser == null) {//GEN-END:|32-getter|0|32-preInit
            // write pre-init user code here
            NewUser = new Command("New User", Command.OK, 0);//GEN-LINE:|32-getter|1|32-postInit
            // write post-init user code here
        }//GEN-BEGIN:|32-getter|2|
        return NewUser;
    }
//</editor-fold>//GEN-END:|32-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ExistingUser ">//GEN-BEGIN:|34-getter|0|34-preInit
    /**
     * Returns an initiliazed instance of ExistingUser component.
     * @return the initialized component instance
     */
    public Command getExistingUser() {
        if (ExistingUser == null) {//GEN-END:|34-getter|0|34-preInit
            // write pre-init user code here
            ExistingUser = new Command("Existing User", Command.OK, 0);//GEN-LINE:|34-getter|1|34-postInit
            // write post-init user code here
        }//GEN-BEGIN:|34-getter|2|
        return ExistingUser;
    }
//</editor-fold>//GEN-END:|34-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem ">//GEN-BEGIN:|22-getter|0|22-preInit
    /**
     * Returns an initiliazed instance of imageItem component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem() {
        if (imageItem == null) {//GEN-END:|22-getter|0|22-preInit
            // write pre-init user code here
            imageItem = new ImageItem("", getImage1(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-LINE:|22-getter|1|22-postInit
            // write post-init user code here
        }//GEN-BEGIN:|22-getter|2|
        return imageItem;
    }
//</editor-fold>//GEN-END:|22-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|30-getter|0|30-preInit
    /**
     * Returns an initiliazed instance of stringItem component.
     * @return the initialized component instance
     */
    public StringItem getStringItem() {
        if (stringItem == null) {//GEN-END:|30-getter|0|30-preInit
            // write pre-init user code here
            stringItem = new StringItem("Welcome User", "");//GEN-LINE:|30-getter|1|30-postInit
            // write post-init user code here
        }//GEN-BEGIN:|30-getter|2|
        return stringItem;
    }
//</editor-fold>//GEN-END:|30-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: form1 ">//GEN-BEGIN:|23-getter|0|23-preInit
    /**
     * Returns an initiliazed instance of form1 component.
     * @return the initialized component instance
     */
    public Form getForm1() {
        if (form1 == null) {//GEN-END:|23-getter|0|23-preInit
            // write pre-init user code here
            form1 = new Form("Sign UP", new Item[]{getStringItem2(), getTextField(), getTextField6(), getTextField2(), getTextField7()});//GEN-BEGIN:|23-getter|1|23-postInit
            form1.addCommand(getBackCommand());
            form1.addCommand(getOkCommand1());
            form1.setCommandListener(this);//GEN-END:|23-getter|1|23-postInit
            // write post-init user code here
        }//GEN-BEGIN:|23-getter|2|
        return form1;
    }
//</editor-fold>//GEN-END:|23-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: form2 ">//GEN-BEGIN:|37-getter|0|37-preInit
    /**
     * Returns an initiliazed instance of form2 component.
     * @return the initialized component instance
     */
    public Form getForm2() {
        if (form2 == null) {//GEN-END:|37-getter|0|37-preInit
            Alert alert1 = null;
            String Pass;
            // write pre-init user code here
            form2 = new Form("Hello!", new Item[]{getStringItem3(), getTextField3()});//GEN-BEGIN:|37-getter|1|37-postInit
            form2.addCommand(getOkCommand());
            form2.addCommand(getBackCommand1());
            form2.addCommand(getOkCommand8());
            form2.addCommand(getOkCommand4());
            form2.setCommandListener(this);//GEN-END:|37-getter|1|37-postInit
            
            
        }//GEN-BEGIN:|37-getter|2|
        return form2;
    }
//</editor-fold>//GEN-END:|37-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|31-getter|0|31-preInit
    /**
     * Returns an initiliazed instance of image1 component.
     * @return the initialized component instance
     */
    public Image getImage1() {
        if (image1 == null) {//GEN-END:|31-getter|0|31-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|31-getter|1|31-@java.io.IOException
                image1 = Image.createImage("/bill buddy 3.png");
            } catch (java.io.IOException e) {//GEN-END:|31-getter|1|31-@java.io.IOException
                e.printStackTrace();
            }//GEN-LINE:|31-getter|2|31-postInit
            // write post-init user code here
        }//GEN-BEGIN:|31-getter|3|
        return image1;
    }
//</editor-fold>//GEN-END:|31-getter|3|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand ">//GEN-BEGIN:|39-getter|0|39-preInit
    /**
     * Returns an initiliazed instance of okCommand component.
     * @return the initialized component instance
     */
    public Command getOkCommand() {
        if (okCommand == null) {//GEN-END:|39-getter|0|39-preInit
            // write pre-init user code here
            okCommand = new Command("Make Payment", Command.OK, 0);//GEN-LINE:|39-getter|1|39-postInit
            // write post-init user code here
        }//GEN-BEGIN:|39-getter|2|
        return okCommand;
    }
//</editor-fold>//GEN-END:|39-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">//GEN-BEGIN:|41-getter|0|41-preInit
    /**
     * Returns an initiliazed instance of backCommand1 component.
     * @return the initialized component instance
     */
    public Command getBackCommand1() {
        if (backCommand1 == null) {//GEN-END:|41-getter|0|41-preInit
            // write pre-init user code here
            backCommand1 = new Command("Back", Command.BACK, 0);//GEN-LINE:|41-getter|1|41-postInit
            // write post-init user code here
        }//GEN-BEGIN:|41-getter|2|
        return backCommand1;
    }
//</editor-fold>//GEN-END:|41-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand1 ">//GEN-BEGIN:|44-getter|0|44-preInit
    /**
     * Returns an initiliazed instance of okCommand1 component.
     * @return the initialized component instance
     */
    public Command getOkCommand1() {
        if (okCommand1 == null) {//GEN-END:|44-getter|0|44-preInit
            // write pre-init user code here
            okCommand1 = new Command("Done", Command.OK, 0);//GEN-LINE:|44-getter|1|44-postInit
            // write post-init user code here
        }//GEN-BEGIN:|44-getter|2|
        return okCommand1;
    }
//</editor-fold>//GEN-END:|44-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem1 ">//GEN-BEGIN:|46-getter|0|46-preInit
    /**
     * Returns an initiliazed instance of stringItem1 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem1() {
        if (stringItem1 == null) {//GEN-END:|46-getter|0|46-preInit
            // write pre-init user code here
            stringItem1 = new StringItem("", "An easy payment tracker for friends and groups via just cellpones");//GEN-LINE:|46-getter|1|46-postInit
            // write post-init user code here
        }//GEN-BEGIN:|46-getter|2|
        return stringItem1;
    }
//</editor-fold>//GEN-END:|46-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem2 ">//GEN-BEGIN:|47-getter|0|47-preInit
    /**
     * Returns an initiliazed instance of stringItem2 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem2() {
        if (stringItem2 == null) {//GEN-END:|47-getter|0|47-preInit
            // write pre-init user code here
            stringItem2 = new StringItem("Hello!", "Please sign up below with your IIIT-D account.");//GEN-LINE:|47-getter|1|47-postInit
            // write post-init user code here
        }//GEN-BEGIN:|47-getter|2|
        return stringItem2;
    }
//</editor-fold>//GEN-END:|47-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField ">//GEN-BEGIN:|48-getter|0|48-preInit
    /**
     * Returns an initiliazed instance of textField component.
     * @return the initialized component instance
     */
    public TextField getTextField() {
        if (textField == null) {//GEN-END:|48-getter|0|48-preInit
            // write pre-init user code here
            textField = new TextField("IIIT-D Email Address", null, 32, TextField.EMAILADDR);//GEN-LINE:|48-getter|1|48-postInit
            // write post-init user code here
        }//GEN-BEGIN:|48-getter|2|
        return textField;
    }
//</editor-fold>//GEN-END:|48-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand2 ">//GEN-BEGIN:|55-getter|0|55-preInit
    /**
     * Returns an initiliazed instance of backCommand2 component.
     * @return the initialized component instance
     */
    public Command getBackCommand2() {
        if (backCommand2 == null) {//GEN-END:|55-getter|0|55-preInit
            // write pre-init user code here
            backCommand2 = new Command("Back", Command.BACK, 0);//GEN-LINE:|55-getter|1|55-postInit
            // write post-init user code here
        }//GEN-BEGIN:|55-getter|2|
        return backCommand2;
    }
//</editor-fold>//GEN-END:|55-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand2 ">//GEN-BEGIN:|57-getter|0|57-preInit
    /**
     * Returns an initiliazed instance of okCommand2 component.
     * @return the initialized component instance
     */
    public Command getOkCommand2() {
        if (okCommand2 == null) {//GEN-END:|57-getter|0|57-preInit
            // write pre-init user code here
            okCommand2 = new Command("Ok", Command.OK, 0);//GEN-LINE:|57-getter|1|57-postInit
            // write post-init user code here
        }//GEN-BEGIN:|57-getter|2|
        return okCommand2;
    }
//</editor-fold>//GEN-END:|57-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand3 ">//GEN-BEGIN:|59-getter|0|59-preInit
    /**
     * Returns an initiliazed instance of okCommand3 component.
     * @return the initialized component instance
     */
    public Command getOkCommand3() {
        if (okCommand3 == null) {//GEN-END:|59-getter|0|59-preInit
            // write pre-init user code here
            okCommand3 = new Command("Ok", Command.OK, 0);//GEN-LINE:|59-getter|1|59-postInit
            // write post-init user code here
        }//GEN-BEGIN:|59-getter|2|
        return okCommand3;
    }
//</editor-fold>//GEN-END:|59-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: screenCommand ">//GEN-BEGIN:|62-getter|0|62-preInit
    /**
     * Returns an initiliazed instance of screenCommand component.
     * @return the initialized component instance
     */
    public Command getScreenCommand() {
        if (screenCommand == null) {//GEN-END:|62-getter|0|62-preInit
            // write pre-init user code here
            screenCommand = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|62-getter|1|62-postInit
            // write post-init user code here
        }//GEN-BEGIN:|62-getter|2|
        return screenCommand;
    }
//</editor-fold>//GEN-END:|62-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand4 ">//GEN-BEGIN:|64-getter|0|64-preInit
    /**
     * Returns an initiliazed instance of okCommand4 component.
     * @return the initialized component instance
     */
    public Command getOkCommand4() {
        if (okCommand4 == null) {//GEN-END:|64-getter|0|64-preInit
            // write pre-init user code here
            okCommand4 = new Command("Check Balance", Command.OK, 0);//GEN-LINE:|64-getter|1|64-postInit
            // write post-init user code here
        }//GEN-BEGIN:|64-getter|2|
        return okCommand4;
    }
//</editor-fold>//GEN-END:|64-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand5 ">//GEN-BEGIN:|68-getter|0|68-preInit
    /**
     * Returns an initiliazed instance of okCommand5 component.
     * @return the initialized component instance
     */
    public Command getOkCommand5() {
        if (okCommand5 == null) {//GEN-END:|68-getter|0|68-preInit
            // write pre-init user code here
            okCommand5 = new Command("Ok", Command.OK, 0);//GEN-LINE:|68-getter|1|68-postInit
            // write post-init user code here
        }//GEN-BEGIN:|68-getter|2|
        return okCommand5;
    }
//</editor-fold>//GEN-END:|68-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand6 ">//GEN-BEGIN:|70-getter|0|70-preInit
    /**
     * Returns an initiliazed instance of okCommand6 component.
     * @return the initialized component instance
     */
    public Command getOkCommand6() {
        if (okCommand6 == null) {//GEN-END:|70-getter|0|70-preInit
            // write pre-init user code here
            okCommand6 = new Command("Ok", Command.OK, 0);//GEN-LINE:|70-getter|1|70-postInit
            // write post-init user code here
        }//GEN-BEGIN:|70-getter|2|
        return okCommand6;
    }
//</editor-fold>//GEN-END:|70-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField2 ">//GEN-BEGIN:|50-getter|0|50-preInit
    /**
     * Returns an initiliazed instance of textField2 component.
     * @return the initialized component instance
     */
    public TextField getTextField2() {
        if (textField2 == null) {//GEN-END:|50-getter|0|50-preInit
            // write pre-init user code here
            textField2 = new TextField("Phone Number", null, 32, TextField.NUMERIC);//GEN-LINE:|50-getter|1|50-postInit
            // write post-init user code here
        }//GEN-BEGIN:|50-getter|2|
        return textField2;
    }
//</editor-fold>//GEN-END:|50-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem3 ">//GEN-BEGIN:|51-getter|0|51-preInit
    /**
     * Returns an initiliazed instance of stringItem3 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem3() {
        if (stringItem3 == null) {//GEN-END:|51-getter|0|51-preInit
            // write pre-init user code here
            stringItem3 = new StringItem("Enter Credentials", null);//GEN-LINE:|51-getter|1|51-postInit
            // write post-init user code here
        }//GEN-BEGIN:|51-getter|2|
        return stringItem3;
    }
//</editor-fold>//GEN-END:|51-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField3 ">//GEN-BEGIN:|52-getter|0|52-preInit
    /**
     * Returns an initiliazed instance of textField3 component.
     * @return the initialized component instance
     */
    public TextField getTextField3() {
        if (textField3 == null) {//GEN-END:|52-getter|0|52-preInit
            // write pre-init user code here
            textField3 = new TextField("Password", null, 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|52-getter|1|52-postInit
            // write post-init user code here
        }//GEN-BEGIN:|52-getter|2|
        return textField3;
    }
//</editor-fold>//GEN-END:|52-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: form3 ">//GEN-BEGIN:|53-getter|0|53-preInit
    /**
     * Returns an initiliazed instance of form3 component.
     * @return the initialized component instance
     */
    public Form getForm3() {
        if (form3 == null) {//GEN-END:|53-getter|0|53-preInit
            // write pre-init user code here
            form3 = new Form("Payment Gateway", new Item[]{getTextField4(), getTextField5()});//GEN-BEGIN:|53-getter|1|53-postInit
            form3.addCommand(getBackCommand2());
            form3.addCommand(getOkCommand2());
            form3.setCommandListener(this);//GEN-END:|53-getter|1|53-postInit
            // write post-init user code here
            
            
            
        }//GEN-BEGIN:|53-getter|2|
        return form3;
    }
//</editor-fold>//GEN-END:|53-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField4 ">//GEN-BEGIN:|74-getter|0|74-preInit
    /**
     * Returns an initiliazed instance of textField4 component.
     * @return the initialized component instance
     */
    public TextField getTextField4() {
        if (textField4 == null) {//GEN-END:|74-getter|0|74-preInit
            // write pre-init user code here
            textField4 = new TextField("Phone Numberto pay to", null, 32, TextField.PHONENUMBER);//GEN-LINE:|74-getter|1|74-postInit
            // write post-init user code here
        }//GEN-BEGIN:|74-getter|2|
        return textField4;
    }
//</editor-fold>//GEN-END:|74-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField5 ">//GEN-BEGIN:|75-getter|0|75-preInit
    /**
     * Returns an initiliazed instance of textField5 component.
     * @return the initialized component instance
     */
    public TextField getTextField5() {
        if (textField5 == null) {//GEN-END:|75-getter|0|75-preInit
            // write pre-init user code here
            textField5 = new TextField("Amount", null, 32, TextField.NUMERIC);//GEN-LINE:|75-getter|1|75-postInit
            // write post-init user code here
        }//GEN-BEGIN:|75-getter|2|
        return textField5;
    }
//</editor-fold>//GEN-END:|75-getter|2|





//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField6 ">//GEN-BEGIN:|79-getter|0|79-preInit
    /**
     * Returns an initiliazed instance of textField6 component.
     * @return the initialized component instance
     */
    public TextField getTextField6() {
        if (textField6 == null) {//GEN-END:|79-getter|0|79-preInit
            // write pre-init user code here
            textField6 = new TextField("NAME", null, 32, TextField.ANY);//GEN-LINE:|79-getter|1|79-postInit
            // write post-init user code here
        }//GEN-BEGIN:|79-getter|2|
        return textField6;
    }
//</editor-fold>//GEN-END:|79-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField7 ">//GEN-BEGIN:|80-getter|0|80-preInit
    /**
     * Returns an initiliazed instance of textField7 component.
     * @return the initialized component instance
     */
    public TextField getTextField7() {
        if (textField7 == null) {//GEN-END:|80-getter|0|80-preInit
            // write pre-init user code here
            textField7 = new TextField("Application Password", null, 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|80-getter|1|80-postInit
            // write post-init user code here
        }//GEN-BEGIN:|80-getter|2|
        return textField7;
    }
//</editor-fold>//GEN-END:|80-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand7 ">//GEN-BEGIN:|82-getter|0|82-preInit
    /**
     * Returns an initiliazed instance of okCommand7 component.
     * @return the initialized component instance
     */
    public Command getOkCommand7() {
        if (okCommand7 == null) {//GEN-END:|82-getter|0|82-preInit
            // write pre-init user code here
            okCommand7 = new Command("Ok", Command.OK, 0);//GEN-LINE:|82-getter|1|82-postInit
            // write post-init user code here
        }//GEN-BEGIN:|82-getter|2|
        return okCommand7;
    }
//</editor-fold>//GEN-END:|82-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert ">//GEN-BEGIN:|81-getter|0|81-preInit
    /**
     * Returns an initiliazed instance of alert component.
     * @return the initialized component instance
     */
    public Alert getAlert() {
        if (alert == null) {//GEN-END:|81-getter|0|81-preInit
            // write pre-init user code here
            String k;
            k =getTextField().getString();


            if (k.length() > 0 && getTextField6().getString().length() > 0 &&  getTextField2().getString().length() == 10 && getTextField7().getString().length() > 0)
            {
                if (k.endsWith("@iiitd.ac.in"));
                else
                   // k.concat("@iiitd.ac.in");
                    getTextField().setString(k.concat("@iiitd.ac.in"));

                messege = "pm_REG_"+getTextField().getString()+"_"+getTextField6().getString()+"_"+getTextField7().getString();
                dStore(textField7.getString());
                try {
                              clientConn=(MessageConnection)Connector.open("sms://"+server);
                        }
                        catch(Exception e) {
                              alert = new Alert("Alert");
                              alert.setString("Unable to connect to Station because of network problem");
                              alert.setTimeout(2000);
                              display.setCurrent(alert);
                        }
                        try {
                              TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
                              textmessage.setAddress("sms://"+server);
                              textmessage.setPayloadText(messege);
                              clientConn.send(textmessage);
                        }
                        catch(Exception e)
                        {
                              Alert alert=new Alert("Alert","",null,AlertType.INFO);
                              alert.setTimeout(Alert.FOREVER);
                              alert.setString("Unable to send");
                              display.setCurrent(alert);
                        }
/*
                     try{
			 clientConn.setMessageListener(
				new MessageListener()
				 {
                                     public void notifyIncomingMessage(MessageConnection clientConn)
					 {
                                            try{
						 Message msg = clientConn.receive();

						 if(msg instanceof TextMessage) {
							 TextMessage tmsg = (TextMessage) msg;
							 reply = tmsg.getPayloadText();
							 System.out.println(tmsg.getPayloadText());
                                                         if (reply.startsWith("OK"))
                                                         {
                                                                s = " Registration Successfull!!\nPlease Deposit the starting amount to activate your account.!!";
                                                                dStore(textField7.getString());
                                                         }
                                                         else if (reply.startsWith("Fail"))
                                                                 s = "Registration unsuccessfull!\n Please contact the adminisstration or Try Again.";
                                                         //else
                                                           //  s = "Data Sent. Awaiting reply!!";
                    				  }
				      	    }
					    catch(Exception e)
					    {
                                                e.printStackTrace();

                            		    }
                       		         }
                		 }
        		   );
		      }
		      catch(Exception e)
	      	      {
                          e.printStackTrace();

		      }*/

            

	 //s = "Data Sent. Awaiting reply!!";
             //  System.out.println(getTextField().getString());

            }

            else
                if(getTextField2().getString().length()>0 && getTextField2().getString().length()!=10)
                {
                    s = "Invalid phone number";
                    alert = new Alert("alert", s, null, null);
                    alert.addCommand(getOkCommand7());
                    alert.setCommandListener(this);
                    alert.setTimeout(Alert.FOREVER);
                }
                else
                {
                    s = "Kindly fill all entries correctly!!!";
                    alert = new Alert("alert", s, null, null);
                    alert.addCommand(getOkCommand7());
                    alert.setCommandListener(this);
                    alert.setTimeout(Alert.FOREVER);
                }
            /*
            alert = new Alert ("alert", "This is Alert", null, null);//GEN-BEGIN:|81-getter|1|81-postInit
            alert.addCommand (getOkCommand7 ());
            alert.setCommandListener (this);
            alert.setTimeout (Alert.FOREVER);//GEN-END:|81-getter|1|81-postInit
            */
            
            // write post-init user code here
        }//GEN-BEGIN:|81-getter|2|
        return alert;
    }
//</editor-fold>//GEN-END:|81-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand8 ">//GEN-BEGIN:|85-getter|0|85-preInit
    /**
     * Returns an initiliazed instance of okCommand8 component.
     * @return the initialized component instance
     */
    public Command getOkCommand8() {
        if (okCommand8 == null) {//GEN-END:|85-getter|0|85-preInit
            // write pre-init user code here
            okCommand8 = new Command("Forgot Password!!", Command.OK, 0);//GEN-LINE:|85-getter|1|85-postInit
            // write post-init user code here
        }//GEN-BEGIN:|85-getter|2|
        return okCommand8;
    }
//</editor-fold>//GEN-END:|85-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert1 ">//GEN-BEGIN:|87-getter|0|87-preInit
    /**
     * Returns an initiliazed instance of alert1 component.
     * @return the initialized component instance
     */
    public Alert getAlert1() {
        if (alert1 == null) {//GEN-END:|87-getter|0|87-preInit
            // write pre-init user code here
            alert1 = new Alert("Reset Password", "Kindly contact administrator to reset password", null, null);//GEN-BEGIN:|87-getter|1|87-postInit
            alert1.setTimeout(Alert.FOREVER);//GEN-END:|87-getter|1|87-postInit
            // write post-init user code here
        }//GEN-BEGIN:|87-getter|2|
        return alert1;
    }
//</editor-fold>//GEN-END:|87-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert2 ">//GEN-BEGIN:|94-getter|0|94-preInit
    /**
     * Returns an initiliazed instance of alert2 component.
     * @return the initialized component instance
     */
    public Alert getAlert2() {
        if (alert2 == null) {//GEN-END:|94-getter|0|94-preInit
            // write pre-init user code here
            //Alert nalert=null;
            String Pass = "";
            String msg = "";
            try {
                rstore = RecordStore.openRecordStore("Store", true);
                
                if (getTextField3().getString().length() <= 0)
                {
                    msg = "Please Enter Password!";
                    alert2 = new Alert("Warning",msg,null,null);
                    alert2.addCommand(getOkCommand9());
                    alert2.setCommandListener(this);
                    alert2.setTimeout(Alert.FOREVER);
                }
                else if (rstore.getNumRecords() == 0)
                {
                    msg = "Please Register";
                    alert2 = new Alert("Warning",msg,null,null);
                    alert2.addCommand(getOkCommand9());
                    alert2.setCommandListener(this);
                    alert2.setTimeout(Alert.FOREVER);
                }
                else
                    System.out.println(rstore.getNumRecords());
                    Pass = new String(rstore.getRecord(1), 0, rstore.getRecord(1).length);
                System.out.println(Pass);
                
                if (!Pass.equalsIgnoreCase(getTextField3().getString()))
                {
                    msg = "Incorrect Password!";
                    alert2 = new Alert("Warning",msg,null,null);
                    alert2.addCommand(getOkCommand9());
                    alert2.setCommandListener(this);
                    alert2.setTimeout(Alert.FOREVER);
                }
                    
            } catch (RecordStoreException ex) {
                ex.printStackTrace();
            
            }
            
            
            
            
            /*
            alert2 = new Alert ("alert2");//GEN-BEGIN:|94-getter|1|94-postInit
            alert2.addCommand (getOkCommand9 ());
            alert2.setCommandListener (this);
            alert2.setTimeout (Alert.FOREVER);//GEN-END:|94-getter|1|94-postInit
            // write post-init user code here*/
        }//GEN-BEGIN:|94-getter|2|
        return alert2;
    }
//</editor-fold>//GEN-END:|94-getter|2|





//<editor-fold defaultstate="collapsed" desc=" Generated Getter: task ">//GEN-BEGIN:|101-getter|0|101-preInit
    /**
     * Returns an initiliazed instance of task component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask() {
        if (task == null) {//GEN-END:|101-getter|0|101-preInit
            // write pre-init user code here
            
            
            task = new SimpleCancellableTask();//GEN-BEGIN:|101-getter|1|101-execute
            task.setExecutable(new org.netbeans.microedition.util.Executable() {

                public void execute() throws Exception {//GEN-END:|101-getter|1|101-execute
// write task-execution user code here
                    
                    
                }//GEN-BEGIN:|101-getter|2|101-postInit
            });//GEN-END:|101-getter|2|101-postInit
            // write post-init user code here
        }//GEN-BEGIN:|101-getter|3|
        return task;
    }
//</editor-fold>//GEN-END:|101-getter|3|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand9 ">//GEN-BEGIN:|105-getter|0|105-preInit
    /**
     * Returns an initiliazed instance of okCommand9 component.
     * @return the initialized component instance
     */
    public Command getOkCommand9() {
        if (okCommand9 == null) {//GEN-END:|105-getter|0|105-preInit
            // write pre-init user code here
            okCommand9 = new Command("Ok", Command.OK, 0);//GEN-LINE:|105-getter|1|105-postInit
            // write post-init user code here
        }//GEN-BEGIN:|105-getter|2|
        return okCommand9;
    }
//</editor-fold>//GEN-END:|105-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert4 ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initiliazed instance of alert4 component.
     * @return the initialized component instance
     */
    public Alert getAlert4() {
        if (alert4 == null) {//GEN-END:|109-getter|0|109-preInit
            String msg ="";
            
            if (getTextField4().getString().length()<=0)
            {
                msg = "Enter Phone number!";
                alert4 = new Alert("Warning",msg,null,null);
                alert4.addCommand(getOkCommand11());
                alert4.setCommandListener(this);
                alert4.setTimeout(Alert.FOREVER);
            }
            if (getTextField5().getString().length()<=0)
            {
                msg = "Enter Amount!";
                alert4 = new Alert("Warning",msg,null,null);
                alert4.addCommand(getOkCommand11());
                alert4.setCommandListener(this);
                alert4.setTimeout(Alert.FOREVER);
            }
            else
            {
            messege = "pm_PAY_"+getTextField4().getString()+"_"+getTextField5().getString();
            
            try {
                              clientConn=(MessageConnection)Connector.open("sms://"+server);
                        }
                        catch(Exception e) {
                              alert = new Alert("Alert");
                              alert.setString("Unable to connect to Station because of network problem");
                              alert.setTimeout(2000);
                              display.setCurrent(alert);
                        }
                        try {
                              TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
                              textmessage.setAddress("sms://"+server);
                              textmessage.setPayloadText(messege);
                              clientConn.send(textmessage);
                        }
                        catch(Exception e)
                        {
                              Alert alert=new Alert("Alert","",null,AlertType.INFO);
                              alert.setTimeout(Alert.FOREVER);
                              alert.setString("Unable to send");
                              display.setCurrent(alert);
                        }
            }
            /*
            alert4 = new Alert ("alert4", "This is Alert", null, null);//GEN-BEGIN:|109-getter|1|109-postInit
            alert4.addCommand (getOkCommand11 ());
            alert4.setCommandListener (this);
            alert4.setTimeout (Alert.FOREVER);//GEN-END:|109-getter|1|109-postInit
            // write post-init user code here*/
        }//GEN-BEGIN:|109-getter|2|
        return alert4;
    }
//</editor-fold>//GEN-END:|109-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand10 ">//GEN-BEGIN:|110-getter|0|110-preInit
    /**
     * Returns an initiliazed instance of okCommand10 component.
     * @return the initialized component instance
     */
    public Command getOkCommand10() {
        if (okCommand10 == null) {//GEN-END:|110-getter|0|110-preInit
            // write pre-init user code here
            okCommand10 = new Command("Ok", Command.OK, 0);//GEN-LINE:|110-getter|1|110-postInit
            // write post-init user code here
        }//GEN-BEGIN:|110-getter|2|
        return okCommand10;
    }
//</editor-fold>//GEN-END:|110-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand11 ">//GEN-BEGIN:|113-getter|0|113-preInit
    /**
     * Returns an initiliazed instance of okCommand11 component.
     * @return the initialized component instance
     */
    public Command getOkCommand11() {
        if (okCommand11 == null) {//GEN-END:|113-getter|0|113-preInit
            // write pre-init user code here
            okCommand11 = new Command("Ok", Command.OK, 0);//GEN-LINE:|113-getter|1|113-postInit
            // write post-init user code here
        }//GEN-BEGIN:|113-getter|2|
        return okCommand11;
    }
//</editor-fold>//GEN-END:|113-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand12 ">//GEN-BEGIN:|118-getter|0|118-preInit
    /**
     * Returns an initiliazed instance of okCommand12 component.
     * @return the initialized component instance
     */
    public Command getOkCommand12() {
        if (okCommand12 == null) {//GEN-END:|118-getter|0|118-preInit
            // write pre-init user code here
            okCommand12 = new Command("Ok", Command.OK, 0);//GEN-LINE:|118-getter|1|118-postInit
            // write post-init user code here
        }//GEN-BEGIN:|118-getter|2|
        return okCommand12;
    }
//</editor-fold>//GEN-END:|118-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert3 ">//GEN-BEGIN:|115-getter|0|115-preInit
    /**
     * Returns an initiliazed instance of alert3 component.
     * @return the initialized component instance
     */
    public Alert getAlert3() {
        if (alert3 == null) {//GEN-END:|115-getter|0|115-preInit
            // write pre-init user code here
            
            //tring x = textField3.getString();
            String Pass = "";
            String msg = "";
            try {
                rstore = RecordStore.openRecordStore("Store", true);
                
                if (getTextField3().getString().length() <= 0)
                {
                    msg = "Please Enter Password!";
                    alert3 = new Alert("Alert",msg, null, null);
                    alert3.addCommand(getOkCommand12());
                    alert3.setCommandListener(this);
                    alert3.setTimeout(Alert.FOREVER);
                }
                else if (rstore.getNumRecords() == 0)
                {
                    msg = "Please Register";
                    alert3 = new Alert("Alert",msg, null, null);
                    alert3.addCommand(getOkCommand12());
                    alert3.setCommandListener(this);
                    alert3.setTimeout(Alert.FOREVER);
                }
                else
                    System.out.println(rstore.getNumRecords());
                    Pass = new String(rstore.getRecord(1), 0, rstore.getRecord(1).length);
                //System.out.println(Pass);
                } catch (RecordStoreException ex) {
                    ex.printStackTrace();
            
                }
                if (!Pass.equalsIgnoreCase(getTextField3().getString()))
                {
                    msg = "Incorrect Password!";
                    alert3 = new Alert("Alert",msg, null, null);
                    alert3.addCommand(getOkCommand12());
                    alert3.setCommandListener(this);
                    alert3.setTimeout(Alert.FOREVER);
                }
                    
            else
                {
            
            
            messege = "pm_CBAL";
            try {
                              clientConn=(MessageConnection)Connector.open("sms://"+server);
                        }
                        catch(Exception e) {
                              
                              alert3 = new Alert("Alert", "Unable to connect to Station because of network problem", null, null);
                              alert3.addCommand(getOkCommand12());
                              alert3.setCommandListener(this);
                              alert3.setTimeout(Alert.FOREVER);
                        }
                        try {
                              TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
                              textmessage.setAddress("sms://"+server);
                              textmessage.setPayloadText(messege);
                              clientConn.send(textmessage);
                        }
                        catch(Exception e)
                        {
                              Alert alert=new Alert("Alert","",null,AlertType.INFO);
                              alert.setTimeout(Alert.FOREVER);
                              alert.setString("Unable to send");
                              display.setCurrent(alert);
                        }
                        alert3 = new Alert("Alert", "Message sent. Await response.", null, null);
                        alert3.addCommand(getOkCommand12());
                        alert3.setCommandListener(this);
                        alert3.setTimeout(Alert.FOREVER);
                }
            /*
            alert3 = new Alert ("Alert", "Message sent. Await response.", null, null);//GEN-BEGIN:|115-getter|1|115-postInit
            alert3.addCommand (getOkCommand12 ());
            alert3.setCommandListener (this);
            alert3.setTimeout (Alert.FOREVER);//GEN-END:|115-getter|1|115-postInit
            // write post-init user code here*/
        }//GEN-BEGIN:|115-getter|2|
        return alert3;
    }
//</editor-fold>//GEN-END:|115-getter|2|

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay() {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable(null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet();
        } else {
            initialize();
            startMIDlet();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }
    
    public void dStore(String pass)
    {
        try {
            rstore = RecordStore.openRecordStore("Store", true);
            System.out.println(pass);
            byte [] x = pass.getBytes();
            rstore.addRecord(x, 0, x.length);
        } catch (RecordStoreException ex) {
            ex.printStackTrace();
            System.out.println(pass);
        }  
        System.out.println(pass+"12");
    }
    
    private boolean Equals(String x, String y)
    {
        boolean val = true;
        
        if (x.length() != y.length())
            return false;
        else
            for (int i=0; i<x.length(); i++)
            {
                if (x.charAt(i) != y.charAt(i))
                {
                    val = false;
                    break;
                }
            }
        
        return val;
    }
    

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }
}
